home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u264.dms / in.adf / ARPPRO3.0 / PRO.RUN / crt0.asm < prev    next >
Encoding:
Assembly Source File  |  1992-04-18  |  2.1 KB  |  92 lines

  1. ; Initial startup routine for Aztec 'C' and ARP
  2. ; NB: This should allow access to all Aztec Features, math, etc.
  3. ;     Could be made smaller if only for CLI, only for Workbench,
  4. ;     Could be made smaller if only this or that.
  5. ;
  6. ; Created 11/08/87 by -+=SDB+=- from crt0.a68 file provided by Manx
  7. ; Copyright (c) 1987 by Scott Ballantyne, may be freely
  8. ; used by Arp Supporters/users
  9.  
  10.     INCLUDE "asmsupp.i"
  11.     INCLUDE "exec/types.i"
  12. ;     INCLUDE "exec/exec_lib.i"
  13.     INCLUDE "exec/alerts.i"
  14.     INCLUDE "libraries/arpbase.i"
  15.  
  16.     XLIB    OpenLibrary
  17.     XLIB    Alert
  18.  
  19.     mc68881
  20.     entry    .begin
  21.     public    .begin
  22. .begin
  23.     bsr    _geta4            ;get A4
  24.     lea    __H1_end,a1
  25.     lea    __H2_org,a2
  26.     cmp.l    a1,a2            ;check if BSS and DATA together
  27.     bne    start            ;no, don't have to clear
  28.     move.w    #((__H2_end-__H2_org)/4)-1,d1
  29.     bmi    start            ;skip if no bss
  30.     move.l    #0,d2
  31. loop
  32.     move.l    d2,(a1)+                ;clear out memory
  33.     dbra    d1,loop
  34.  
  35. start
  36.     move.l    sp,__savsp        ;save stack pointer
  37.     move.l    4,a6            ;get Exec's library base pointer
  38.     move.l    a6,_SysBase        ;put where we can get it
  39.     movem.l d0/a0,-(sp)             ;save CLI command parameters
  40.  
  41.     btst.b    #4,$129(a6)             ;check for 68881 flag in AttnFlags
  42.     beq    1$            ;skip if not
  43.     lea    2$,a5
  44.     jsr    -30(a6)                 ;do it in supervisor mode
  45.     bra    1$
  46. 2$
  47.     clr.l    -(sp)
  48.     frestore (sp)+                  ;reset the ffp stuff
  49.     rte                ;and return
  50. 1$
  51.  
  52.     if 0
  53.  
  54.     lea    ARPNAME,a1        ;get name of arp_library
  55.     moveq.l #ArpVersion,d0
  56.     SYSCALL OpenLibrary
  57.     move.l    d0,_ArpBase        ; set up pointer
  58. ;     move.l  d0,_DOSBase         ; also as Dos pointer
  59.     bne    3$            ; skip if okay
  60.     add.w    #8,sp
  61.     GURU    AG_OpenLib!AO_ArpLib
  62. 3$
  63.     move.l    d0,a0
  64.     move.l    DosBase(a0),_DOSBase    ; Give free dos.library
  65.     move.l    GfxBase(a0),_GfxBase    ; Give free graphics.library
  66.     move.l    IntuiBase(a0),_IntuitionBase ; and free intuition.library
  67.  
  68.     endc
  69.  
  70.     jsr    __main            ;call the startup stuff
  71. 4$
  72.     add.w    #8,sp            ;pop args
  73.     rts                ;and return
  74.  
  75. ; ARPNAME:      ArpName
  76.  
  77.     public    _geta4
  78. _geta4:
  79.     far    data
  80.     lea    __H1_org+32766,a4
  81.     rts
  82.  
  83.     public    __main,__H0_org
  84.  
  85.     dseg
  86.  
  87.     public    _SysBase,__savsp  ; ,_DOSBase
  88.     public    __H1_org,__H1_end,__H2_org,__H2_end
  89. ;     public  _ArpBase
  90. ;     public  _IntuitionBase,_GfxBase
  91.  
  92.